-
Notifications
You must be signed in to change notification settings - Fork 3k
API, Core: Fix naming in fastForwardBranch/replaceBranch APIs #9134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API, Core: Fix naming in fastForwardBranch/replaceBranch APIs #9134
Conversation
|
cc @rakesh-das08 @singhpk234 This stems from our discussion on #8854 (comment) |
d33430d to
08e41ce
Compare
core/src/main/java/org/apache/iceberg/UpdateSnapshotReferencesOperation.java
Outdated
Show resolved
Hide resolved
08e41ce to
f8a7c24
Compare
| Preconditions.checkArgument(sourceRef != null, "Ref does not exist: %s", source); | ||
| Preconditions.checkArgument(refToUpdate.isBranch(), "Ref %s is a tag not a branch", name); | ||
| String from, String to, boolean fastForward) { | ||
| Preconditions.checkNotNull(from, "Branch to update cannot be null"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're a little inconsistent here in terms of null checking (throwing NPE vs IAE) but I guess that's out-of-scope for this PR, so just wanted to mention that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah you're right, and this unfortunately applies to more than just replace/fastForward. (e.g. create, rename, as well throw an NPE instead of IAE). I'll take this in a follow on.
|
Merging, thanks for the reviews @nastra @rakesh-das08 |
This change fixes some very confusing naming from my original implementation of the fastForward/replaceBranch APIs.
Prior to this change, the APIs had the following naming:
"Name" is the branch that would be fast forwarded and source is the "destination" or target we would fast forward to. This doesn't really align with how most people would think when it comes to fast forward or replace operations (like Git).
This change renames it to:
Note: This is just a rename of parameters and error messages. There is no change in behavior in the API.